{% macro docs_sidebar(current_section) %}
<div>
	<nav class="flex gap-5 md:gap-10 flex-wrap py-8" aria-label="Main navigation">
		{% set index_path = current_section ~ "/_index.md" | trim_start_matches(pat="/") %}
		{% set index = get_section(path=index_path) %}
		{% if index.pages %}
		<div>
			<h3>{{ index.title }}</h3>
			<ul>
				{% for page in index.pages %}
				<li><a class="{% if current_url == page.permalink %} active{% endif %} text-background"
						href="{{ page.permalink | safe }}">{{ page.title }}

					</a></li>
				{% endfor %}
			</ul>
		</div>
		{% endif %}
		{% if index.subsections %}
		{% for s in index.subsections %}
		{% set subsection = get_section(path=s) %}
		{% if subsection.pages %}
		<div>
			<h3 class="mb-2 md:mb-4 py-1 text-sm font-semibold text-white border-b border-red-100">{{ subsection.title }}</h3>
			<ul class="mb-4">
				{% for page in subsection.pages %}
				<li>
					<a class="inline-block w-full py-1 hover:text-white text-sm {% if current_url == page.permalink %} text-white font-semibold {% else %} text-red-200 dark:text-zinc-400{% endif %}"
						href="{{ page.permalink | safe }}">{{ page.title }}
					</a>
				</li>
				{% endfor %}
			</ul>
		</div>
		{% endif %}
		{% endfor %}
		{% endif %}
	</nav>
</div>
{% endmacro %}
